package org.pictual.controller.mainPackage;

import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Vector;

import org.pictual.controller.MyImage;


public class ParamWrapper {

    private String title;
    private CategoriesWrapper _categories;
    private Vector<MyImage> images;
    private Vector<String> otherLanguages;

    public class WrapperState{
        public static final int DEFINITION = 0;
        public static final int OTHER_LANGS = 1;
        public static final int NO_RESULTS = 2;
    }

    private int state;

    public ParamWrapper() {
    }

    public void setState(int s){
        state = s;
    }

    public int getState(){
        return state;
    }

    ParamWrapper(String query, Vector<MyImage> images, CategoriesWrapper categories){
        this.title = query;
        this.images = images;
        _categories = categories;
    }

    public CategoriesWrapper  getInformation() {
        return _categories;
    }

    public void setInformation(CategoriesWrapper categories) {
        _categories = categories;
    }

    public void setOtherLanguages(Vector<String> languages) {
        this.otherLanguages = languages;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setImages(Vector<MyImage> images){
        this.images = images;
    }

    public int getAmountImgs(){
        if(images == null)
        {
            return 0;
        }
        return images.size();
    }

    public String getImgLink(int index){
        return images.elementAt(index).getImgLink();
    }

    public String getImgRef(int index){
        return images.elementAt(index).getImgRef();
    }

    public String getStyle(int index){
        return images.elementAt(index).getStyle();
    }

    public int getImgWidth(int index){
        return images.elementAt(index).getWidth();
    }

    public int getImgHeigth(int index){
        return images.elementAt(index).getHeight();
    }

    public int getAmountLangs(){
        if(otherLanguages == null)
        {
            return 0;
        }
        return otherLanguages.size();
    }

    public String getLanguage(int index){
        return otherLanguages.elementAt(index);
    }

    public Iterator<Entry<String,DefinitionList>> getCategIterator()
    {
    	//DefinitionList dl=new DefinitionList();
    	_categories.putDefinitionList("dummy");
    	System.out.println("dummy");
        return _categories.getIterator();
    }
}

